package org.javaboy.demo;

import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.core.env.ConfigurableEnvironment;

/**
 * @author Lyh
 * @date 2024/2/7 1:08
 * @desciption:
 */
public class XmlDemo {
    public static void main(String[] args) {
        ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext();
        ConfigurableEnvironment env = ctx.getEnvironment();
        env.addActiveProfile("prod");
        ctx.setConfigLocations("beans.xml");
        ctx.refresh();
        DataSource ds1 = ctx.getBean(DataSource.class);
        System.out.println("ds1 = " + ds1);
    }
}
